import request from '@/utils/request'

// 查询供应商商品列表
export function listGood(query) {
  return request({
    url: '/fx/supplier/good/list',
    method: 'get',
    params: query
  })
}

// 查询供应商商品详细
export function getGood(id) {
  return request({
    url: '/fx/supplier/good/' + id,
    method: 'get'
  })
}


// 查询扫码商品详情
export function supplierGood(id) {
  return request({
    url: '/fx/store/good/supplier/' + id,
    method: 'get'
  })
}

// 扫码出库
export function outBound(data) {
  return request({
    url: '/fx/order/outBound',
    method: 'post',
    data: data
  })
}
// 批量采购
export function buyGood(data) {
  return request({
    url: '/fx/purchase/adds',
    method: 'post',
    data: data
  })
}

// 新增供应商商品
export function addGood(data) {
  return request({
    url: '/fx/supplier/good',
    method: 'post',
    data: data
  })
}

// 修改供应商商品
export function updateGood(data) {
  return request({
    url: '/fx/supplier/good',
    method: 'put',
    data: data
  })
}

// 删除供应商商品
export function delGood(id) {
  return request({
    url: '/fx/supplier/good/' + id,
    method: 'delete'
  })
}

//根据最后一级id查询模板
export function hierarchy(query) {
  return request({
    url: '/fx/model/hierarchy',
    method: 'get',
    params: query
  })
}

// 供应商下拉列表
export function listSupplierName() {
  return request({
    url: '/fx/join/getSupplierList',
    method: 'get'
  })
}
